﻿namespace Mercury.ParticleEngine
{
    using System;
    using Xunit;
    using FluentAssertions;

    public class RanduRandomGeneratorTests
    {
        public class NextIntegerMethod
        {
            [Fact]
            [Trait("Type", "RanduRandomGenerator")]
            public void ReturnsRandomIntegers()
            {
                var subject = new RanduRandomGenerator();

                for (var i = 0; i < 1000; i++)
                {
                    var value = subject.NextInteger();

                    value.Should().BeGreaterOrEqualTo(0);
                    value.Should().BeLessOrEqualTo(Int32.MaxValue);
                }
            }
        }

        public class NextSingleMethod
        {
            [Fact]
            [Trait("Type", "RanduRandomGenerator")]
            public void ReturnsRandomSingles()
            {
                var subject = new RanduRandomGenerator();

                for (var i = 0; i < 1000; i++)
                {
                    var value = subject.NextSingle();

                    value.Should().BeGreaterOrEqualTo(0f);
                    value.Should().BeLessOrEqualTo(1f);
                }
            }
        }
    }
}